import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/third_party_user_train_record_entity.dart';

ThirdPartyUserTrainRecordEntity $ThirdPartyUserTrainRecordEntityFromJson(Map<String, dynamic> json) {
  final ThirdPartyUserTrainRecordEntity thirdPartyUserTrainRecordEntity = ThirdPartyUserTrainRecordEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    thirdPartyUserTrainRecordEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    thirdPartyUserTrainRecordEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    thirdPartyUserTrainRecordEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    thirdPartyUserTrainRecordEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    thirdPartyUserTrainRecordEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    thirdPartyUserTrainRecordEntity.id = id;
  }
  final int? qualified = jsonConvert.convert<int>(json['qualified']);
  if (qualified != null) {
    thirdPartyUserTrainRecordEntity.qualified = qualified;
  }
  final int? trainAchievement = jsonConvert.convert<int>(json['trainAchievement']);
  if (trainAchievement != null) {
    thirdPartyUserTrainRecordEntity.trainAchievement = trainAchievement;
  }
  final String? trainBeginDate = jsonConvert.convert<String>(json['trainBeginDate']);
  if (trainBeginDate != null) {
    thirdPartyUserTrainRecordEntity.trainBeginDate = trainBeginDate;
  }
  final String? trainImageUrl = jsonConvert.convert<String>(json['trainImageUrl']);
  if (trainImageUrl != null) {
    thirdPartyUserTrainRecordEntity.trainImageUrl = trainImageUrl;
  }
  final String? trainInfo = jsonConvert.convert<String>(json['trainInfo']);
  if (trainInfo != null) {
    thirdPartyUserTrainRecordEntity.trainInfo = trainInfo;
  }
  final String? trainName = jsonConvert.convert<String>(json['trainName']);
  if (trainName != null) {
    thirdPartyUserTrainRecordEntity.trainName = trainName;
  }
  final String? trainType = jsonConvert.convert<String>(json['trainType']);
  if (trainType != null) {
    thirdPartyUserTrainRecordEntity.trainType = trainType;
  }
  final String? trainTypeLabel = jsonConvert.convert<String>(json['trainTypeLabel']);
  if (trainTypeLabel != null) {
    thirdPartyUserTrainRecordEntity.trainTypeLabel = trainTypeLabel;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    thirdPartyUserTrainRecordEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    thirdPartyUserTrainRecordEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    thirdPartyUserTrainRecordEntity.updateDate = updateDate;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    thirdPartyUserTrainRecordEntity.userId = userId;
  }
  return thirdPartyUserTrainRecordEntity;
}

Map<String, dynamic> $ThirdPartyUserTrainRecordEntityToJson(ThirdPartyUserTrainRecordEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['qualified'] = entity.qualified;
  data['trainAchievement'] = entity.trainAchievement;
  data['trainBeginDate'] = entity.trainBeginDate;
  data['trainImageUrl'] = entity.trainImageUrl;
  data['trainInfo'] = entity.trainInfo;
  data['trainName'] = entity.trainName;
  data['trainType'] = entity.trainType;
  data['trainTypeLabel'] = entity.trainTypeLabel;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['userId'] = entity.userId;
  return data;
}

extension ThirdPartyUserTrainRecordEntityExtension on ThirdPartyUserTrainRecordEntity {
  ThirdPartyUserTrainRecordEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    int? qualified,
    int? trainAchievement,
    String? trainBeginDate,
    String? trainImageUrl,
    String? trainInfo,
    String? trainName,
    String? trainType,
    String? trainTypeLabel,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? userId,
  }) {
    return ThirdPartyUserTrainRecordEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..qualified = qualified ?? this.qualified
      ..trainAchievement = trainAchievement ?? this.trainAchievement
      ..trainBeginDate = trainBeginDate ?? this.trainBeginDate
      ..trainImageUrl = trainImageUrl ?? this.trainImageUrl
      ..trainInfo = trainInfo ?? this.trainInfo
      ..trainName = trainName ?? this.trainName
      ..trainType = trainType ?? this.trainType
      ..trainTypeLabel = trainTypeLabel ?? this.trainTypeLabel
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..userId = userId ?? this.userId;
  }
}
